const express=require('express');
const router=express.Router();
const PageJson=require("../model/PageJson");
const Score_infoService=require("../services/Score_infoService");


//查询成绩
router.get("/queryScore/:s_id/:exam_id",async(req,resp)=>{
  var score_infoService=new Score_infoService();
  try {
    var result=await score_infoService.queryScore(req.params.s_id,req.params.exam_id);
    if(result.length==1){
      resp.json(new PageJson("success","查询成功",result[0]));
    }
    else{
      resp.json(new PageJson("error","查询失败，无此信息"));
    }
  } catch (error) {
    console.log(error);
    resp.json(new PageJson("error","服务器错误"));
  }
});





module.exports=router;